package com.cskaoyan.wordmemorize.controller.admin;

import com.cskaoyan.wordmemorize.common.result.Result;
import com.cskaoyan.wordmemorize.dto.admin.OperateLogDTO;
import com.cskaoyan.wordmemorize.dto.admin.PageDTO;
import com.cskaoyan.wordmemorize.request.OperateLogPageRequest;
import com.cskaoyan.wordmemorize.service.AdminLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 管理员操作日志控制器
 */
@RestController
@RequestMapping("/admin/log")
public class AdminLogController {

    @Autowired
    private AdminLogService adminLogService;

    /**
     * 分页查询系统操作日志(后台操作日志)
     *
     * @param request 查询请求参数
     * @return 分页结果
     */
    @GetMapping("/operation/list")
    public Result<PageDTO<OperateLogDTO>> getOperateLogPage(OperateLogPageRequest request) {
        PageDTO<OperateLogDTO> pageDTO = adminLogService.getOperateLogPage(request);
        return Result.ok(pageDTO);
    }
}
